<template>
  <div>
    <h2>商品详情</h2>
    商品id:{{goods.id}}<br>
    商品标题:{{goods.title}}<br>
    商品价格:{{goods.price}}<br>
    商品描述:{{goods.desc}}<br>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: '',
      goods: {
        id: '',
        title: '',
        price: '',
        show_num: 0,
        desc: ''
      }, // 商品信息
    }
  },
  mounted() {
    this.id = this.$route.query.id
    this.axios.get('http://127.0.0.1:8000/goods/' + this.id + '/').then(res => {
      console.log(res.data)
      this.goods = res.data
    })
  }
}
</script>

<style>
</style>